#pragma once

#include <Windows.h>

class NetworkGraphics
{
private:
	HDC hdc;
	double currentFactor;
	int currDx;
	int currDy;

	void transform(LONG *x, LONG *y);

	void drawRect(RECT rect);
	void fillRect(RECT rect);
	void drawLine(int x1, int y1, int x2, int y2);
	void loadRectPath(RECT rect);

	POINT getRectMiddle(RECT r);

	static const int MACHINE_SIZE = 20;
	static const int BUFFER_WIDTH = 30;
	static const int BUFFER_CELL_HEIGHT = 10;
	static const int NEST_INNER_PADDING = 5;
	static const int CONNECTION_MARGIN = 30;

public:
	NetworkGraphics(HDC hdc);
	~NetworkGraphics(void);

	void scale(double factor);
	void translate(int dx, int dy);

	void drawMachine(int x, int y, bool isBuisy);
	void drawBuffer(int x, int y, int capacity, int count);
	RECT drawNest(int x, int y, int bufferCapacity, int bufferCount, int machinesCount, bool machinesBusiness []);
	void drawConnection(RECT firstNest, RECT secondNest);	
};

